<div style="margin-bottom: 8px">
  <button nz-button nzType="primary" (click)="showActivityModal()">添加</button>
</div>
<!--表格-->
<nz-table #table [nzData]="tableData"
          nzSize="small"
          nzShowSizeChanger
          nzShowPagination="false"
          [nzFrontPagination]="false"
>
  <thead>
  <tr>
    <th nzAlign="center">序号</th>
    <th nzAlign="center">活动名称</th>
    <th nzAlign="center">活动类型</th>
    <th nzAlign="center">生效时间</th>
    <th nzAlign="center">活动状态</th>
    <th nzAlign="center" nzWidth="200px">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of table.data;let index=index;">
    <td nzAlign="center">{{ index + 1 }}</td>
    <td nzAlign="center">{{ data['title'] }}</td>
    <td nzAlign="center">{{ data['activityType'] === 1 ? '充值送积分' : '-' }}（{{data['integralMultiple']}}倍积分）</td>
    <td nzAlign="center">{{ data['beginTime'] }}-{{ data['endTime'] }}</td>
    <td nzAlign="center" [attr.statusColor]="data['status']">{{ STATUS[data['status']] }}</td>
    <td nzAlign="center">
      <a (click)="showActivityModal(data)">编辑</a>
    </td>
  </tr>
  </tbody>
</nz-table>


<!--分类管理-->
<nz-modal
  [(nzVisible)]="editModal.visible"
  nzTitle="分类管理"
  (nzOnCancel)="hideActivityModal()">
  <div *nzModalContent>
    <div class="rowItem">
      <label class="label"><span>*</span>活动名称</label>
      <input nz-input placeholder="请输入活动名称" [(ngModel)]="editModal.title"/>
    </div>
    <div class="rowItem">
      <label class="label"><span>*</span>活动类型</label>
      <nz-radio-group [(ngModel)]="editModal.activityType">
        <label nz-radio [nzValue]="1">充值送积分</label>
      </nz-radio-group>
    </div>
    <div class="rowItem">
      <label class="label"><span>*</span>积分设置</label>
      <nz-input-group nzAddOnBefore="送" nzAddOnAfter="倍积分" style="width: 180px">
        <nz-input-number nzPlaceHolder="请输入" style="width: 100%" [nzMin]="0" [nzMax]="9999999" [nzPrecision]="0"
                         [(ngModel)]="editModal.integralMultiple"></nz-input-number>
      </nz-input-group>
    </div>
    <div class="rowItem">
      <label class="label"><span>*</span>生效时间</label>
      <nz-range-picker style="width: 350px"
                       [nzShowTime]="{ nzFormat: 'HH:mm:ss' }"
                       nzFormat="yyyy-MM-dd HH:mm:ss"
                       [(ngModel)]="editModal.time"></nz-range-picker>
    </div>
  </div>
  <div *nzModalFooter>
    <button nz-button nzType="default" (click)="hideActivityModal()">取消</button>
    <button nz-button nzType="primary" (click)="saveActivity()">确认</button>
  </div>
</nz-modal>
